package com.wwdx.service.impl;

import com.google.common.collect.Maps;
import com.wwdx.model.ReVersionModel;
import com.wwdx.service.ReVersionServiceI;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author liguoliang
 */
@Service
public class ReVersionServiceImpl extends BaseServiceImpl<ReVersionModel> implements ReVersionServiceI{

    @Override
    public Long selectModelCount(ReVersionModel model) {
        return count("select count(1) from ReVersionModel");
    }

    @Override
    public List<ReVersionModel> selectModelList(ReVersionModel model, Integer page, Integer rows) {
        return find("from ReVersionModel", page, rows);
    }

    @Override
    public ReVersionModel getVersionModel(Long channelid) {
        Map<String, Object> params = Maps.newHashMapWithExpectedSize(2);
        params.put("channeid", channelid);
        return getByHql("from ReVersionModel where channeid=:channeid", params);
    }
}